#pragma once
namespace mutou
{
	template <class iterator,class Ref ,class Ptr>
	class Reverse_iterator
	{
		typedef Reverse_iterator<iterator, Ref, Ptr> self;
	public:
		Reverse_iterator(const iterator& val)
			:current(val)
		{

		}
		Ref operator*()
		{
			iterator tmp = current;
			--tmp;
			return *tmp;
		}
		Ptr operator->()
		{
			return &(operator*());
		}
		self& operator--()
		{
			++current;
			return *this;
		}
		self& operator++()
		{
			--current;
			return *this;
		}
		self operator--(int)
		{
			
			self tmp = *this;
			++current;
			return tmp;
		}
		self operator++(int)
		{
			self tmp = *this;
			--current;
			return tmp;
		}
		bool operator!=(const self& it)
		{
			return current != it.current;
		}
		bool operator==(const self& it)
		{
			return current == it.current;
		}
	private:
		iterator current;
	};
}
